function fcs(element_id) {
	var element = document.getElementById(element_id);
	element.defaultValue = '';
	element.value = '';
	element.focus();
}
function clr(element_id) {
	var element = document.getElementById(element_id);
	element.defaultValue = '';
	element.value = '';
}

function toggle(element_id) {
	var element = document.getElementById(element_id);
	if (element != null) {
		if (element.style.display == "none") element.style.display = "block";
		else element.style.display = "none";
	}
}

function show_inline(element_id) {
	var element = document.getElementById(element_id);
	if (element != null) element.style.display = "inline";
}

function hide(element_id) {
	var element = document.getElementById(element_id);
	if (element != null) element.style.display = "none";
}

function submit(form_id) {
	document.getElementById(form_id).submit();
}

function validate_password(pwd_id, cnf_id) {
	var password = document.getElementById(pwd_id);
	var confirm  = document.getElementById(cnf_id);
	
	if (password.value.length <= 5) {
		alert('Passwords must be at least 6 characters long.');
		password.focus();
		return false;
	} else if (password.value != confirm.value) {
		alert('Passwords do not match, please try again.');
		password.value = '';
		confirm.value = '';
		password.focus();
		return false;
	}
	return true;
}
